package com.itheima.controller.d_request;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/request")
public class RequestController {

    @RequestMapping("header")
    public String header(@RequestHeader("Accept") String accept){
        System.out.println(accept);
        return "success";
    }

    @RequestMapping("/cookie")
    public String cookie(@CookieValue("JSESSIONID") String sessionid){
        System.out.println(sessionid);
        return "success";
    }

    @RequestMapping("/body")
    public String body(@RequestBody String body){
        System.out.println(body);
        return "success";
    }
}
